package com.whmskj.xjlhsc.mobie.Scheduling.controller;

import com.whmskj.xjlhsc.controller.vo.Result;
import com.whmskj.xjlhsc.mobie.Scheduling.Dto.DcSchedulingQueryDto;
import com.whmskj.xjlhsc.mobie.Scheduling.entity.vo.DcSchedulingVo;
import com.whmskj.xjlhsc.mobie.empProPlan.service.ProPersonnelStandConfirmService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author 张
 * @version 1.0
 */

@RestController
@RequestMapping("/mob/personScheduling")
@Slf4j
@Tag(description = "人员排班", name = "人员排班")
public class PersonSchedulingController {

    @Autowired
    private ProPersonnelStandConfirmService proPersonnelStandConfirmService;

    @PostMapping("/personSchedulingList")
    @Operation(description = "人员排班列表显示")
    public Result personSchedulingList(@RequestBody DcSchedulingQueryDto dcSchedulingQueryDto){
        List<DcSchedulingVo> list =  proPersonnelStandConfirmService.personSchedulingList(dcSchedulingQueryDto);
        return Result.success(list);
    }

    @DeleteMapping("{id}")
    @Operation(description = "删除人员排班")
    public Result delete(@PathVariable(name = "id") Long id){
        proPersonnelStandConfirmService.deleteConfirm(id);
        return Result.success();
    }

}
